package com.tcat.item.pojo;

import com.fasterxml.jackson.annotation.JsonIgnore;
import io.swagger.annotations.ApiModel;
import lombok.Data;
import tk.mybatis.mapper.annotation.KeySql;

import javax.persistence.Column;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Transient;
import java.util.Date;
import java.util.List;

@ApiModel(description = "Spu")
@Table(name = "tb_spu")
@Data
public class Spu {
    @Id
    @KeySql(useGeneratedKeys=true)
    private Long id;
    private Long brandId;
    // 1级类目

    private Long cid1;
    // 2级类目

    private Long cid2;
    // 3级类目

    private Long cid3;
    //标题

    private String title;
    //子标题

    @Column(name="sub_title")
    private String subTitle;
    //是否上架

    private Boolean saleable;
    //是否有效，逻辑删除使用

    @JsonIgnore
    private Boolean valid;
    // 创建时间

    @Column(name="create_time")
    private Date createTime;
    // 最后修改时间

    @JsonIgnore
    @Column(name="last_update_time")
    private Date lastUpdateTime;
    // 商品分类名称



    // 商品详情

    @Transient
    private SpuDetail spuDetail;
    // sku列表

    @Transient
    private List<Sku> skus;

}
